# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         test06
# Description:  重复
# Author:       ASUS
# Date:         2019/3/25
#-------------------------------------------------------------------------------


import re
s = "a*"            #表示字符出现0到n次
strList = ["","a","aa","baa"]
for value in strList:
    m = re.match(s,value)
    print(m)        #因为“a*”可以匹配空串，而任何字符串都可以看作是以空串为前缀，所以“baa”只是空串的后缀，所以可以匹配

s = "a+"            #表示字符串出现1到n次
for value in strList:
    m = re.match(s,value)
    print(m)

#要想将多个字符作为一组重复，需要一对原括号将这个字符串括起来
s = "(abc)+"
print(re.match(s,"abcabcabc"))


